﻿/**
*非诉申请
*/
Chenxin.UI.NotLitigationForm = Chenxin.extend(Chenxin.UI.FormCommon, {
    actionUrl: '/service/logic/ShowListNotLitigation.ashx',
    id: 'NotLit',
    renderTo: 'divNotLit',
    title: '非诉申请',
    jqmWidth: 450,
    defBBtn:true,
    createForm: function() {
        return Chenxin.FormCommon.NotLitigationForm(this.id);
    },
	initFormValidator:function(){
	    //物业地址
        $("#HouseAddress").formValidator({
            validatorgroup: this.id,
            onshow: "请输入物业地址！",
            onfocus: "物业地址为必输项",
            oncorrect: " "
        }).inputValidator({ 
            min: 1,
            empty: {
                leftempty: false,
                rightempty: false,
                emptyerror: "物业地址不能为空！"
            },
            onerror: "物业地址不能为空！"
        });
        //受理时间
        $("#AcceptedDate").formValidator({
            validatorgroup: this.id,
            onshow: "请输入受理时间！",
            onfocus: "受理时间为必输项",
            oncorrect: " "
        }).inputValidator({ 
            min: 1,
            empty: {
                leftempty: false,
                rightempty: false,
                emptyerror: "受理时间不能为空！"
            },
            onerror: "受理时间不能为空！"
        });
        //发函时间
        $("#MailDate").formValidator({
            validatorgroup: this.id,
            onshow: "请输入发函时间！",
            onfocus: "发函时间为必输项",
            oncorrect: " "
        }).inputValidator({ 
            min: 1,
            empty: {
                leftempty: false,
                rightempty: false,
                emptyerror: "发函时间不能为空！"
            },
            onerror: "发函时间不能为空！"
        });
        //发函内容
        $("#Description").formValidator({
            validatorgroup: this.id,
            onshow: "请输入发函内容！",
            onfocus: "发函内容为必输项",
            oncorrect: " "
        }).inputValidator({ 
            min: 1,
            empty: {
                leftempty: false,
                rightempty: false,
                emptyerror: "发函内容不能为空！"
            },
            onerror: "发函内容不能为空！"
        });
    },
    initEvent: function() {
        var _this = this;

        $("#AcceptedDate").focus(function(){
            WdatePicker({dateFmt:'yyyy-MM-dd',oncleared:function(){$(this).blur();},onpicked:function(){$(this).blur();}})
        });
        
         $("#MailDate").focus(function(){
            WdatePicker({dateFmt:'yyyy-MM-dd',oncleared:function(){$(this).blur();},onpicked:function(){$(this).blur();}})
        });
    },
    createComboList:function(){
        //提交部门
        var comboAppDepartId = new Chenxin.UI.DepartTreeCombo({
			containerId: '#NotAppDepartId',
            textBoxId: 'NotAppDepartId',
            name: 'AppDepartId',
            inModelType: 'all',
            txtModelName: 'AppDepart',
            required: true,
            afterSetValue: function(val, txt) {
            },
            onSelected: function() {
            }
		});
        return [comboAppDepartId];
    },
    saveSucc: function() {
        this.reloadGrid();
    },
    initComponent: function() {
        Chenxin.UI.NotLitigationForm.superclass.initComponent.call(this);
    }
});

Chenxin.FormCommon.NotLitigationForm=function(formID){
	return '<table class="tbl_f"><tr><th style="width:105px; height:26px;">成交编号：</th><td><input name="ContractCode" class="inputbox_n fl" type="text" readonly="readonly" style="width:150px;"/></td></tr><tr><th>物业地址：</th><td><input name="HouseAddress" class="inputbox_n fl" type="text" style="width:300px;"/></td></tr><tr><th>提交部门：</th><td><input type=text id="NotAppDepartId" class="inputbox_n fl" style="width:151px" /></td></tr><tr><th>受理时间：</th><td><input id="AcceptedDate" name="AcceptedDate" class="inputbox_n fl" type="text" style="width:150px;" readonly="readonly"/></td></tr><tr><th>发函时间：</th><td><input id="MailDate" name="MailDate" class="inputbox_n fl" type="text" style="width:150px;" readonly="readonly"/></td></tr><tr><th>发函内容：</th><td><textarea id="Description" name="Description" class="textarea_n" type="text" style=" float:left; width: 300px; height: 50px; padding:5px;"/></td></tr><tr><th>备注：</th><td><textarea id="Memo" name="Memo" class="textarea_n" type="text" style=" float:left; width: 300px; height: 50px; padding:5px;"/></td></tr><tr><td colspan="2" ><input type="hidden" name="RecordId" /></td></tr></table>';
};